package org.ki.gra;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.GL10;
import com.badlogic.gdx.graphics.OrthographicCamera;

/**
 * User: kieronsk
 * Date: 10/9/12
 * Time: 4:06 PM
 */
abstract class ScreenHelper implements com.badlogic.gdx.Screen {

    protected final OrthographicCamera kamera;


    protected ScreenHelper() {
        kamera = new OrthographicCamera();
    }

    @Override
    public void render(float delta) {
        Gdx.gl.glClearColor(0,0,0,1);
        Gdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT);
        kamera.update();
    }

    @Override
    public void resize(int width, int height) {
        int wysokosc = 10;
        float proporcje = (width / (float) height);
        if (width>height)
        {
            kamera.viewportHeight = wysokosc;
            kamera.viewportWidth = wysokosc * proporcje;
        }
        else
        {
            kamera.viewportHeight = wysokosc / proporcje;
            kamera.viewportWidth = wysokosc;
        }
    }

    @Override
    public void show() {
    }

    @Override
    public void hide() {
    }

    @Override
    public void pause() {
    }

    @Override
    public void resume() {
    }

    @Override
    public void dispose() {
    }
}
